cmake_minimum_required(VERSION 2.8)

project(libstk)

aux_source_directory(. SOURCES)
include_directories(${STK_INC_DIR})

set(HEADERS
    stk_accept.h
    stk_base.h
    stk_body.h
    stk_cache_control.h
    stk_connection.h
    stk_const.h
    stk_accept_encoding.h
    stk_content_encoding.h
    stk_content_base.h
    stk_content_length.h
    stk_content_type.h
    stk_cseq.h
    stk_date.h
    stk_exports.h
    stk_host.h
    stk_message_base.h
    stk_message_http.h
    stk_message_rtsp.h
    stk_public.h
    stk_range.h
    stk_rtp_message.h
    stk_scale.h
    stk_server.h
    stk_session.h
    stk_transport.h
    stk_utility.h
    stk_vary.h
    stk_origin.h
    stk_cors_origin.h
    stk_allow.h
    stk_upgrade.h
    stk_websock_key.h
    stk_websock_accept.h
    stk_websock_version.h
    stk_websock_extensions.h
    )

if(WIN32)
    add_definitions(-DSTK_EXPORTS)
endif()

if(BUILD_SHARED_LIBS)
    add_library(stk SHARED ${SOURCES} ${HEADERS})
    install(TARGETS stk DESTINATION lib)
endif()

if(BUILD_STATIC_LIBS)
    add_library(stk_static STATIC ${SOURCES} ${HEADERS})
    set_target_properties(stk_static PROPERTIES OUTPUT_NAME "stk")
    install(TARGETS stk_static DESTINATION lib)
endif()

install(FILES ${HEADERS} DESTINATION include/stk)
